{% comment %}
<!--
  Copyright (C) 2010 ZHENG Zhong <http://www.zhengzhong.net/>
  Created on 2010-05-10.
  $Id$
-->
{% endcomment %}


{% if dish_form %}

  <form id="dish-form" class="xl-form" action="." method="POST">

    <div class="field">
      {% if dish_form.instance %}
        <div class="label">Name:</div>
        <div class="hidden">{{ dish_form.name|safe }}</div>
        <div class="disabled-value">{{ dish_form.instance.name|escape }}</div>
      {% else %}
        <div class="label">Name: *</div>
        <div class="input required">{{ dish_form.name|safe }}</div>
        {% if dish_form.name.errors %}
          <div class="error-list">{{ dish_form.name.errors|safe }}</div>
        {% endif %}
      {% endif %}
    </div>

    <div class="field">
      <div class="label">Description:</div>
      <div class="input">{{ dish_form.description|safe }}</div>
      {% if dish_form.description.errors %}
        <div class="error-list">{{ dish_form.description.errors|safe }}</div>
      {% endif %}
    </div>

    <div class="field">
      <div class="label">Photo URL:</div>
      <div class="input">{{ dish_form.photo_url|safe }}</div>
      {% if dish_form.photo_url.errors %}
        <div class="error-list">{{ dish_form.photo_url.errors|safe }}</div>
      {% endif %}
    </div>

    <div class="field">
      <div class="label">Additional Information:</div>
      <div class="checkbox">
        <div>
          {{ dish_form.is_spicy|safe }} This dish is spicy.
        </div>
        <div>
          {{ dish_form.is_vegetarian|safe }} This dish is vegetarian.
        </div>
      </div>
      {% if dish_form.is_spicy.errors or dish_form.is_vegetarian.errors %}
        <div class="error-list">
          {{ dish_form.is_spicy.errors|safe }}
          {{ dish_form.is_vegetarian.errors|safe }}
        </div>
      {% endif %}
    </div>

    <div class="field">
      <div class="label">Price:</div>
      <div class="input">{{ dish_form.price|safe }}</div>
      {% if dish_form.price.errors %}
        <div class="error-list">{{ dish_form.price.errors|safe }}</div>
      {% endif %}
    </div>

    <div class="field">
      <input class="button" type="submit" value="{{ dish_form.instance|yesno:'Update,Recommend' }}"/>
      &nbsp; or,
      <a href="{% url friday.view_resto resto_id=resto.id %}">
        return to {{ resto|escape }}
      </a>
    </div>

  </form>

{% endif %}



